home *** CD-ROM | disk | FTP | other *** search
- Hints and Tips
- 4.12
- • Basic line lengths revisited (Archive 4.10 p7) − The Basic line input
- buffer is 238 characters and so this is the most you can type in from
- the Basic prompt. Once entered, this line is tokenised before being
- stored as part of a program. Most of the keywords are reduced to only
- one byte, so the line ends up taking up much less room in a program. The
- maximum length for a line in a program is 255 bytes, but four of these
- bytes have special purposes (one is a line terminator, one the line
- length and two the line number). This leaves 251 bytes for the rest of
- the line. So what’s the point in allowing bigger lines in the program if
- you can’t type them in? Well, you can by being devious. Try typing the
- following at the Basic prompt:
- 4.12
- 10E.:E.:E.: etc
- 4.12
- until you hit the line limit and then press Return. Listing your program
- now should reveal:
- 4.12
- 10ENDPROC:ENDPROC:ENDPROC: etc
- 4.12
- up to a length of about 790 characters! This line is perfectly valid and
- would run OK (although I can’t think of a program where 79 ENDPROCs in a
- row would be useful!) but is much too long to edit at the Basic prompt
- or in the Basic Editor. It wouldn’t be sensible for the Basic Editor to
- limit you to 251 characters since, once tokenised, your line would be
- much shorter, so it allows you to type up to 369 characters hoping that
- tokenising will bring it back to 251. It objects if you try to type in
- more than 369 characters; it also objects if you type a shorter line
- which would be longer than 251 characters once tokenised (try REM
- followed by 300 letters). As for solving the problem, if you have a copy
- of Twin, you could try loading your Basic program into it. Twin has no
- line length limit and will cope with anything. Returning to Basic will
- always work provided the resulting tokenised lines would be no longer
- than 251 characters. Lorcan Mongey
- 4.12
- • Citizen printer spare parts − You may be interested to know that you
- can get spare parts for Citizen printers from XMA Ltd, Ruddington Lane,
- Wilford, Nottingham, NG11 7EP. (0602 −818222) Rob Brown, Tadworth,
- Surrey.
- 4.12
- • Fatal error type = 5 − !Edit will report this error if you have too
- many outline fonts in your !Fonts folder. This will prevent you from
- editing any documents within !Edit. The following Basic program will
- solve this problem by hiding the !Fonts folder before running !Edit and
- then restoring it once !Edit has been run.
- 4.12
- 1. Rename the ‘!RunImage’ file inside the ‘!Edit’ folder as ‘EditImage’.
- 4.12
- 2. Type the following program in and then save it as ‘!RunImage’ in the
- ‘!Edit’ folder.
- 4.12
- REM ><Edit$Dir>.!RunImage
- 4.12
- SYS “Wimp_Initialise”,200,&4B534154, “EditStart” TO ,taskid%
- 4.12
- *Set temp <Font$Prefix>
- 4.12
- *UnSet Font$Prefix
- 4.12
- *WimpSlot -min 160k -max 160k
- 4.12
- *WimpSlot -min 160k
- 4.12
- SYS “Wimp_StartTask”,“Run <Edit$Dir> .EditImage ”+FNenv_string
- 4.12
- *Set Font$Prefix <temp>
- 4.12
- *Unset temp
- 4.12
- SYS “Wimp_CloseDown”,,taskid% ,&4B534154
- 4.12
- END
- 4.12
-
- 4.12
- DEFFNenv_string
- 4.12
- LOCAL env$,x%
- 4.12
- SYS “OS_GetEnv” TO env$
- 4.12
- IF LEN(env$)<6 THEN =“”
- 4.12
- WHILE INSTR(env$,“ ”,x%)>0
- 4.12
- x%=INSTR(env$,“ ”,x%)+1
- 4.12
- ENDWHILE
- 4.12
- =RIGHT$(env$,LEN(env$)-x%+1)
- 4.12
- • Locating the I/O podule (a SWI number change) − Those writing code
- for the I/O podule for use on different machines should note that Acorn
- made a SWI number change between version 1.04 and 1.06 of the software
- (use *Help Modules to find what version you have). Earlier issues of the
- podule use &4043F for SWI “I/O _Podule_Hardware” whereas the later
- versions use &40500. ARM code assembled on a machine with one version of
- the software will not work on another machine with a different version
- without changing this SWI number. Richard House, Surrey.
- 4.12
- • PC screen fonts − If you are not overly fond of the chunky IBM
- character set in the PC emulator, the following few lines of Basic will
- modify the emulator ROM file with the BBC font of your choice.
- 4.12
- REM >PCFONT
- 4.12
- REM Merge BBC FONT file into !PC ROM file
- 4.12
- REM N.B. *** COPY ORIGINAL ROM FILE BEFORE RUNNING THIS ***
- 4.12
- :
- 4.12
- DIM rom% &2000 : offset%=&166E
- 4.12
- R$=“:4.$.!PC.ROM”
- 4.12
- OSCLI(“Load ”+R$+“ ”+STR$~rom%)
- 4.12
- A%=OPENIN(R$) : r1%=EXT#A% : CLOSE#A%
- 4.12
- :
- 4.12
- F%=OPENIN(“4:.BBCFONTS.NEWFONT”) : REM file of type &FF7
- 4.12
- REPEAT
- 4.12
- A%=BGET#F%
- 4.12
- IF A%<>23 THEN PRINT “This is not a BBC font file!” : END
- 4.12
- C%=BGET%F%
- 4.12
- FOR I%=0 TO 7
- 4.12
- rom%?(offset%+((C%+128) MOD 256) *8+ I%)=BGET#F%
- 4.12
- NEXT I%
- 4.12
- UNTIL EOF#F%
- 4.12
- CLOSE#F%
- 4.12
- :
- 4.12
- OSCLI(“Save ”+R$+“ ”STR$~rom%+ “ + ”+STR$~r1%)
- 4.12
- END
- 4.12
- This program has been used successfully on the ROM files supplied with
- version 1.33 and the latest 1.60 (large and small) − each version stores
- its VDU 23 character definitions from offset &166E onwards. Pete Bready,
- Glasgow.
- 4.12
- • Impression Junior styles? − In the June 1991 edition of Archive, it
- was pointed out that Impression Junior does not have styles. Although it
- does not have styles, it does have rulers. These are intended to define
- margins and tab-stops, but they can be used for other things.
- 4.12
- If you save a text story with effects, you will see the definition of a
- ruler, which looks like:
- 4.12
-
- 4.12
- There will also be the definition of the BaseStyle, which contains a
- number of additional commands. By copying some of these to the ruler
- definition, you can create the equivalent of a style. As an example, a
- ‘style’ that changes the font of the text subject to the ruler to greek,
- could be, for example:
- 4.12
-
- 4.12
- As Impression Junior does not have the facility to create rulers with
- these extensions, they must be written using an ordinary text editor
- (such as !Edit) and imported into Impression where they become rulers.
- 4.12
- The commands that I know work are:
- 4.12
- font <font name> − e.g. Greek, Trinity.Medium, etc
- 4.12
- fontsize <size>pt − 8 to 20 is reasonable
- 4.12
- fontaspect <size>% −
- 100 normal, 200 stretches to twice size
- 4.12
- fontcolour rgb = (<n>,<n>,<n>) − n is from 0 to 1 or 0 to 100 (both
- appear to work)
- 4.12
- linecolour rgb = (<n>,<n>,<n>) − as above
- 4.12
- justify [left, right, centre, full] − full is to both margins
- 4.12
- underline [0,1] − other
- values also work but give strange underline
- 4.12
- strikeout [on, off] −
- writes ‘-’ over characters
- 4.12
- script [off, sub, super] −
- sub and super-scripts
- 4.12
- leader “<text>” − overwrites
- tab character
- 4.12
- By using these additional commands, it is possible to generate some very
- useful rulers.
- 4.12
- Simon Callan, Borehamwood. A
- 4.12
-
-